<script>
export default {
	onLaunch: function() {
    // #ifdef MP-WEIXIN
    this.globalConfig.changeSiteIdFn(uni.getStorageSync('siteId'))

    const updateManager = uni.getUpdateManager() // 小程序版本更新管理器
    updateManager.onCheckForUpdate(res => { // 检测新版本后的回调
      if(res.hasUpdate) { // 如果有新版本提醒并进行强制升级
        uni.showModal({
          content: '新版本已经准备好，是否重启应用？',
          showCancel: false,
          confirmText: '确定',
          success: res => {
            if (res.confirm) {
              updateManager.onUpdateReady(res => { // 新版本下载完成的回调
                updateManager.applyUpdate() // 强制当前小程序应用上新版本并重启
              })

              updateManager.onUpdateFailed(res => { // 新版本下载失败的回调
                // 新版本下载失败，提示用户删除后通过冷启动重新打开
                uni.showModal({
                  content: '下载失败，请删除当前小程序后重新打开',
                  showCancel: false,
                  confirmText: '知道了'
                })
              })
            }
          }
        })
      }
    })
    // #endif


    this.httpClient.post({
      url: this.APIPath.config.detail,
      data: {}
    }).then(res => {
      this.storage.setConfig(res.data)
      this.storage.setDrawConfig(res.data.draw)
    })
    },
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
// #ifdef H5
uni-page-body, uni-page-wrapper{
  height: 100% !important;
}
uni-page-wrapper::after{
  display: none !important;
}
.uni-tabbar-bottom{
  display: none !important;
}
// #endif


@import "./framework/uview-ui/index";
@import "./framework/style/comm";
@import 'static/iconfont/iconfont';
	/*每个页面公共css */
page{
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans',
  'Droid Sans', 'Helvetica Neue', 'Microsoft Yahei', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 26rpx;
  -webkit-overflow-scrolling : touch;
  padding: 0;
  margin: 0;
  //background-image: linear-gradient(to right, #E8F4FC , #FDFDFD);
  background: #F6F6F6;
  //color: #040404;
  color: #101012;
  word-break: break-word;
}

.page{
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;

  .s-head{
    width: 100%;
    z-index: 1;
  }
  .s-body{
    flex: 1;
    overflow: hidden;
  }
  .s-footer{

  }
}

view, image, text {
  box-sizing: border-box;
  flex-shrink: 0;
}

#app {
  width: 100vw;
  height: 100vh;
}

.custom-page{
  display: flex;
  flex-direction: column;
  height: 100vh !important;

  & > view{
    &:nth-child(2) {
      flex: 1;
      overflow: auto;
    }
  }
}

.footer-page{
  & > view:nth-child(2){
    padding-bottom: 200rpx;
  }
}

.button-hover {
  background-color:transparent;
}
.flex-between{
  justify-content: space-between;
}
.flex-row{
  display: flex;
  flex-direction: row;
}
.flex-column{
  display: flex;
  flex-direction: column;
}
</style>
